package com.lagou.edu.remote;

import com.lagou.edu.dto.CourseDTO;
import com.lagou.edu.response.ResponseDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@FeignClient(name = "edu-course-boot", path="/course")
public interface CourseRemoteService {

    @GetMapping("/getAllCourses")
    public List<CourseDTO> getAllCourses();

    @PostMapping("/saveOrUpdate")
    ResponseDTO saveOrUpdateCourse(@RequestBody CourseDTO courseDTO);

    @PostMapping("/swithOnlineStatus")
    public ResponseDTO switchOnlineStatus(@RequestBody CourseDTO courseDTO);
}
